﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace LightCAD.Core
{
    public class Circle2d : ICurve2d
    {
        public Curve2dType Type => Curve2dType.Circle2d;

        [JsonInclude]
        public Vector2d Center;
        public double Radius { get; set; }

        [JsonIgnore]
        public bool IsClosed => true;
        [JsonIgnore]
        public object Source { get; set; }
        public string Name { get ; set ; }

        public void Copy(ICurve2d src)
        {
            var cir = src as Circle2d;
            this.Center= cir.Center;
            this.Radius = cir.Radius;
            this.Name = cir.Name;
        }
        public ICurve2d Clone()
        {
            var newObj = new Line2d();
            newObj.Copy(this);
            return newObj;
        }
        object ICloneable.Clone()
        {
            return this.Clone();
        }
    }
}
